import request from './request'
// 牧场新增
export const livestockAdd = (addLivestock) => {
  return request({
    url: '/livestock/add',
    method: 'post',
    data: addLivestock,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 牧场列表
export const livestockList = (params) => {
  return request({
    url: '/livestock/list',
    method: 'get',
    param: params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

//  牧场详情
export const livestockDetail = (livestockId) => {
  return request({
    url: '/livestock/detail',
    method: 'get',
    param: {
      livestockId
    },
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 修改牧场
export const livestockUpdate = (updateLivestock) => {
  return request({
    url: '/livestock/update',
    method: 'post',
    data: updateLivestock,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 转栏
export const livestockChange = (changeLivestock) => {
  return request({
    url: '/livestock/change',
    method: 'post',
    data: changeLivestock,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 转栏记录
export const livestockChangeRecord = (params) => {
  return request({
    url: '/livestock/changeRecord',
    method: 'get',
    params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
// 转栏
export const livestockOut = (outLivestock) => {
  return request({
    url: '/livestock/out',
    method: 'post',
    data: outLivestock,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}

// 出栏记录
export const livestockOutRecord = (params) => {
  return request({
    url: '/livestock/outRecord',
    method: 'get',
    params,
    headers: {
      isToken: true,
      repeatSubmit: false
    }
  })
}
